package com.my.blog.website;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * 包含了@ComponentScan、@Configuration和@EnableAutoConfiguration注解。
 *      其中
 *          @ComponentScan让spring Boot扫描到Configuration类并把它加入到程序上下文。
 *          @EnableAutoConfiguration 自动配置。
 *          @ComponentScan 组件扫描，可自动发现和装配一些Bean。
 */
@SpringBootApplication
@EnableCaching
@MapperScan(basePackages = "com.my.blog.website.dao")
public class CoreApplication {

    /*@Bean(initMethod = "init", destroyMethod = "close")
    @ConfigurationProperties(prefix = "spring.datasource")
    public DataSource dataSource() {
        DataSource dataSource = new DruidDataSource();
        return dataSource;
    }*/

    public static void main(String[] args) {
        SpringApplication.run(CoreApplication.class, args);
    }
}
